package ModelLayer;


public class SalesOrderLine 
{
	private int amount;
	private int salesLineId;
	private Product product;
	private Store store;
	private SalesOrder sale;

	//Empty Constructor
	public SalesOrderLine()
	{
		
	}
	
	//Constructor which takes; amount, product and store as a parameter
	public SalesOrderLine(int amount, Product product, Store store)
	{
		this.amount = amount;
		this.product = product;
		this.store = store;
	}

	//Returns the amount
	public int getAmount() 
	{
		return amount;
	}
	
	//Returns the sales line ID
	public int getSalesLineId() 
	{
		return salesLineId;
	}

	//Sets the sales line ID
	public void setSalesLineId(int salesLineId) 
	{
		this.salesLineId = salesLineId;
	}


	//Sets the amount
	public void setAmount(int amount) 
	{
		this.amount = amount;
	}
	
	//Returns the product
	public Product getProduct()
	{
		return product;
	}
	
	//Sets the product
	public void setProduct(Product product)
	{
		this.product = product;
	}
	
	//Returns the store
	public Store getStore()
	{
		return store;
	}
	
	//Sets the store
	public void setStore(Store store)
	{
		this.store = store;
	}
	
	//Returns the total price
	public double getTotalPrice()
	{
		double totalPrice = 0;
		totalPrice = amount * product.getSalesPrice();
		return totalPrice;
	}
	
	//Returns the sale
	public SalesOrder getSale() 
	{
		return sale;
	}

	//Sets the sale
	public void setSale(SalesOrder sale) 
	{
		this.sale = sale;
	}
		
}
